Release 10.1A: OpenEdge Development:
ADM and SmartObjects
Creating the new class files
You create the new class files with the New ADM Class tool, located on the AppBuilder menu bar. To start the New ADM Class tool, choose Tools
New ADM Class... from the menu bar, shown in Figure 8–2.
Figure 8–2: New ADM Class menu option
![]()
Invoking this command opens the New ADM Class dialog box, shown in Figure 8–3.
Figure 8–3: New ADM Class (initial)
![]()
This dialog box contains two tabs. In the Basic tab, you name the class and supply various file and directory names and locations. The Custom Files tab provides information about the new custom files for this class. The following sections describe how to use these tabs.
The Basic tab
The Basic tab initially contains only one fill-in field, Name, in which you enter the name of your new class. After you specify a class name, fill-in fields open for the other labels on this tab. These fields contain automatically generated default names based on the class name you supply. For example, specifying the class name as
mybrowserand the class from which to derive as...browser.cldproduces the result shown in Figure 8–4.Figure 8–4: Basic tab with fill-in fields
![]()
The default names follow the standard Progress naming convention. Progress Software Corporation recommends you use these names but does not require that you do so. Recall that once you save your new class, you cannot change the file and directory names for your new class.
Table 8–1 lists and describes the fill-in fields in this tab.
Check the Replace existing files if exist option at the bottom of the Basic tab if you want to open these files in the AppBuilder once they have been created.
The Custom Files tab
The Custom Files tab displays all the custom files (hooks) that will be generated when the new class is created. Like the file and directory names in the Basic tab’s fill-in fields, these filenames are generated automatically based on the class name you supply, and thus they are not filled until after you specify a class name. For example, specifying the class name mybrowser in the Basic tab produces the result in the Custom Files tab shown in Figure 8–5.
Figure 8–5: Custom Files tab
![]()
The custom files allow you to modify and/or extend a class after it is deployed, without altering the basic class itself. They are described in more detail in the "Custom class files" section.
Creating the class files
Once you supply all the information required in the Basic tab, including specifying whether to open the files in the AppBuilder, you are almost ready to create the files.
Before you create them, however, you must decide whether the AppBuilder should replace files that already exist when it creates the class files. To specify this, either check or uncheck the Replace existing files if exist option at the bottom of the New ADM Class dialog box, as appropriate. You can now create the class by clicking OK. (To cancel the operation, click Cancel.)
When the AppBuilder creates a new class, it generates these files:
- Class definition file:
class-name.cld- Primary include file:
prim-incl-file.i- Property file:
prop-file.i- Prototype file:
proto-file.i- Super procedure:
super-proc.p- Template:
template-file.w
(if specified in the Basic tab of the New ADM Class dialog box)- Custom primary include file:
prim-incl-filecustom.i- Custom property file:
prop-filecustom.i- Custom prototype file:
proto-filecustom.i- Custom super procedure:
super-proccustom.p- Custom exclude definition file:
class-nameexclcustomm.i- Custom instance definition file:
class-namedefscustom.i- The r-code for the super procedures in the r-code
directory.7You already should be familiar with the standard class files. For descriptions of them, see the "Adding application logic to your new or customized ADM class" section.
Warnings and error messages
When the AppBuilder tries to create a new class, it uses validation controls to check whether pathnames and filenames are correct and whether files already exist. If it is successful in creating the class, the AppBuilder advises you of this:
![]()
If the validation process fails, the AppBuilder displays a warning message and does not generate code. The following are warnings and error messages the AppBuilder might display:
- Saving the Class Without a Class Name — If you try to save the class without providing a class name, the AppBuilder displays the following error message:
![]()
- Generating Your Files Directly in the DLC Directory — Progress Software Corporation recommends you do not install user-defined code in the
DLCdirectory. If you try to do this, the AppBuilder displays the following warning message:
![]()
The warning gives you the option of creating a similar directory structure in your working directory (that is,
\src\adm2). If you choose to do this, and any of the directories specified do not yet exist, you are prompted to create them:
![]()
If you choose not to create the directory, the AppBuilder stops processing and does not generate files. You must provide a valid directory name and then try again.
- File Generation Error — If an error occurs while the AppBuilder is generating class files, it displays a message and stops processing. For example:
![]()
If the AppBuilder stops processing during file generation, it does not delete files that it has finished generating.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |